home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 140
/
(Vol 140) Sep 19 2011.iso
/
Games
/
world-wars.swf
/
scripts
/
DefineSprite_376
/
frame_1
/
DoAction.as
Wrap
Text File
|
2011-09-19
|
3KB
|
135 lines
function setArmy()
{
if(army._currentframe == 1)
{
_parent.ARMY = 1;
}
if(army._currentframe == 2)
{
_parent.ARMY = 2;
}
if(army._currentframe == 3)
{
_parent.ARMY = 3;
}
}
function resetPlayers()
{
var _loc2_ = 2;
while(_loc2_ <= 8)
{
this["p" + _loc2_].gotoAndStop(1);
_loc2_ = _loc2_ + 1;
}
}
function rollButton(mc)
{
mc.onRollOver = function()
{
this.gotoAndStop(2);
};
mc.onRollOut = mc.onReleaseOutside = function()
{
this.gotoAndStop(1);
};
}
rollButton(PLAY_BTN);
rollButton(MUSIC_BTN_ON);
rollButton(MUSIC_BTN_OFF);
rollButton(HELP_BTN);
PLAY_BTN.onRelease = function()
{
_global.SOUNDS.playSound("Click- głośniejszy.wav");
_parent.OUTRO.gotoAndPlay(2);
};
HELP_BTN.onRelease = function()
{
if(_parent.HELP_MC._currentframe == 1)
{
_parent.HELP_MC.gotoAndPlay(2);
_global.SOUNDS.playSound("okno help open.wav");
_parent.HELP_MC._visible = true;
}
};
MUSIC_BTN_ON._visible = !_global.ARE_SOUNDS;
MUSIC_BTN_OFF.onRelease = function()
{
_global.SOUNDS.playSound("Click- głośniejszy.wav");
this._visible = false;
MUSIC_BTN_ON.gotoAndStop(2);
MUSIC_BTN_ON._visible = true;
_global.ARE_SOUNDS = false;
_global.SOUNDS.killSoundtrack();
};
MUSIC_BTN_ON.onRelease = function()
{
_global.SOUNDS.playSound("Click- głośniejszy.wav");
this._visible = false;
MUSIC_BTN_OFF.gotoAndStop(2);
MUSIC_BTN_OFF._visible = true;
_global.ARE_SOUNDS = true;
_global.SOUNDS.menuSoundtrack();
};
army.gotoAndStop(_parent.ARMY);
nn.onRelease = function()
{
_global.SOUNDS.playSound("Click- głośniejszy.wav");
var _loc2_ = army._currentframe + 1;
if(_loc2_ > 3)
{
_loc2_ = 1;
}
army.gotoAndStop(_loc2_);
setArmy();
};
pp.onRelease = function()
{
_global.SOUNDS.playSound("Click- głośniejszy.wav");
var _loc2_ = army._currentframe - 1;
if(_loc2_ < 1)
{
_loc2_ = army._totalframes;
}
army.gotoAndStop(_loc2_);
setArmy();
};
nn.onRollOver = pp.onRollOver = function()
{
this.gotoAndStop(2);
};
nn.onRollOut = nn.onReleaseOutside = pp.onRollOut = pp.onReleaseOutside = function()
{
this.gotoAndStop(1);
};
this["p" + _parent.PL].gotoAndStop(2);
var CHOSEN = this["p" + _parent.PL];
var i = 2;
while(i <= 8)
{
this["p" + i].i = i;
this["p" + i].onRelease = function()
{
_global.SOUNDS.playSound("Click- głośniejszy.wav");
resetPlayers();
CHOSEN.gotoAndStop(1);
CHOSEN = this;
this.gotoAndStop(2);
_parent.PL = this.i;
};
this["p" + i].onRollOver = function()
{
if(CHOSEN != this)
{
this.gotoAndStop(2);
}
};
this["p" + i].onRollOut = this["p" + i].onReleaseOutside = function()
{
if(CHOSEN != this)
{
this.gotoAndStop(1);
}
};
i++;
}